package com.kikyou.service.impl;

import com.kikyou.mapper.OplogMapper;
import com.kikyou.pojo.Oplog;
import com.kikyou.service.IOplogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kikyou.utils.AdminUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yuankaiqiang
 * @since 2022-03-09
 */
@Service
public class OplogServiceImpl extends ServiceImpl<OplogMapper, Oplog> implements IOplogService {
    @Autowired
    private OplogMapper oplogMapper;
    @Override
    public boolean  insertMessage(String message){
        Oplog oplog =new Oplog(null, new Date(),(AdminUtils.getCurrentAdmin().getName()+message),AdminUtils.getCurrentAdmin().getId());
        return oplogMapper.insert(oplog)>0;
    }
}
